<extend name="./Application/Common/View/block/base.php" />
<block name="header">
    <include file="block:easyui_header" />
    <link href="__PUBLIC__/css/admin_index.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="__PUBLIC__/js/adminLoadedThread.js"></script>
</block>
<block name="bdoy">
    <?php
        $key_to_value_model = gt_base::load_model('KeyToValue');
    ?>
    <body>
        <div class="easyui-layout" style="width:100%;height:100%;">
            <div data-options="region:'north',title:'',split:false" class="header">
                <div class="logo_text">
                    <span><?php echo $key_to_value_model ->get_value('website_name');?></span>
                </div>
                <div class="right">
                    <ul class="tool-ul">
                        <li>你好：<?php echo get_module_session('Admin', 'realname');?>[<?php echo get_module_session('Admin', 'role');?>]</li>
                        <li><a href="/Admin/Login/loginOut">[退出]</a></li>
                    </ul>
                    <div class="easyui-tabs top-tab-div" id="tab">
                        <volist name="menus" id="menu">
                            <div title="{:LANG($menu['name'])}" menu_id="{$menu['id']}"></div>
                        </volist>
                    </div>
                </div>
            </div>
            <div data-options="region:'west',split:true" title="导航"  width="150">
                <?php //echo D('Menu')->get_easyui_menu_tree();?>
                <ul id="menu_tree" class="easyui-tree menu-tree" data-options="url:'__URL__/get_tree_menu?pid=1602',lines:true"></ul>
            </div>
            <div data-options="region:'center',border:false,split:true" class="easyui-tabs main-content" id="tabs" style="overflow: hidden">
                <iframe id="temp_iframe" scrolling="auto" frameborder="0" style="width:100%;height:100%;"></iframe>
            </div>
        </div>
    </body>
</block>
<block name="footExtendJs">
    <script>
        $(function(){
            $('#tab').tabs({
                border:false,
                onSelect:function(title,index){

                    get_menu($('#tab').tabs('getTab', index).attr('menu_id'));
                     //这里写你要怎么处理这个选中的tab
                }
            });
        });

        function get_menu(pid){
            var url = '__URL__/get_tree_menu?pid='+pid;
            $.getJSON(url, function(data){
                $('#menu_tree').tree('loadData', data);
                console.log(data);
            });
        }
    </script>
</block>
